package io;


import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
       FileOutputStream fos = new FileOutputStream("acc.txt",true);

        String str = "aaaaabbbbb\ncccccddddd\n";
        byte[] bytes=str.getBytes(StandardCharsets.UTF_8);
        fos.write(bytes);
        System.out.println("写入成功");

        String str2="sssss\nvvvvv\n";
        bytes=str2.getBytes(StandardCharsets.UTF_8);
        fos.write(bytes);

        fos.close();
    }
}
